<template>
   <el-row>
        <el-button  :disabled= "inputNum > 1 ? false : true" @click="reduceNum()" class="el-icon-minus"></el-button>
        <el-input class="input-number" type="text" :value="inputNum" ></el-input>
        <el-button @click="addNum()" class="el-icon-plus"></el-button>
   </el-row>
</template>

<script>
export default {
    data(){
        return {
            inputNum:1,
        }
    },
    methods:{
        reduceNum(){
           this.inputNum--
           this.$emit('change',this.inputNum)
        },
        addNum(){
            this.inputNum++
            this.$emit('change',this.inputNum)
        }
    }
}
</script>

<style scoped>
  .input-number{
    width: 80px;
    text-align: center;
  }
</style>